<!-- 保险产品详情 -->
<template>
  <div class="dy-main InsurancePrdDetail">
    <div class="dy-header">
       <x-header :right-options="{showMore: false}" :left-options="{preventGoBack:true}" @on-click-back="back">产品详情</x-header>
    </div>
    <div class="dy-body">
      <scroller lock-x height="100%" ref="scroller">
        <div>
          <img class="prdImg" src="../../assets/img/Financial/nodataImg.png">
          <div class="prdMsg">
            <div class="titleMsg">产品介绍</div>
            <group gutter="0">
              <cell :title="('产品类别')" :value="InsuranceType"></cell>
              <cell :title="('预期收益')" :value="expectMoney"></cell>
              <cell :title="('起点金额')" :value="initAmount"></cell>
              <cell :title="('投保年龄范围')" :value="ageLimit"></cell>
              <cell :title="('保障期限')" :value="insuTime"></cell>
              <cell :title="('缴费方式')" :value="payMethod"></cell>
              <cell :title="('缴费年限')" :value="payTime"></cell>
              <cell :title="('最低保费')" :value="minAmt"></cell>
              <cell :title="('可附加险种')" :value="kindOfInsurance"></cell>
              <cell :title="('风险提示')" :value="riskWaring"></cell>
            </group>
          </div>
        </div>
      </scroller>
    </div>
    <div class="dy-footer">
      <div class="buyConfirm" @click="buyNow()">立即投保</div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      InsuranceType: '',
      expectMoney: '',
      initAmount: '',
      ageLimit: '',
      insuTime: '',
      payMethod: '',
      payTime: '',
      minAmt: '',
      kindOfInsurance: '',
      riskWaring: ''
    }
  },
  methods: {
    buyNow () {
      this.$router.push({name: 'InsuranceOffer'})
    },
    getDetailData () {
      let self = this
      this.$bridge.callhandler('nativeRequest',
        JSON.stringify({'requstSource': 'internetRequest', 'url': 'mstep.do?act=business', 'params': {'method_Name': 'InsuranceDetailSearchData'}}),
        function (response) {
          response = JSON.parse(response)
          if (response.status === 0 || response.status === '0') {
            let data = response.data.data[0]
            self.InsuranceType = data.InsuranceType
            self.expectMoney = data.expectMoney
            self.initAmount = data.initAmount
            self.ageLimit = data.ageLimit
            self.insuTime = data.insuTime
            self.payMethod = data.payMethod
            self.payTime = data.payTime
            self.minAmt = data.minAmt
            self.kindOfInsurance = data.kindOfInsurance
            self.riskWaring = data.riskWaring
          } else {
            alert('fail')
          }
        }
      )
    },
    back () {
      this.$publicFun.goBack(this)
    }
  },
  created () {
    this.getDetailData()
  }
}
</script>

<style lang="less">
.InsurancePrdDetail{
  .dy-body{
    padding-bottom: 1rem;
    .prdMsg{
      width: 100%;
      background: #fff;
      margin-bottom: 1rem;
      .titleMsg{
        color: #333333;
        font-size: 0.33rem;
        font-weight: bolder;
        height: 0.88rem;
        line-height: 0.88rem;
        padding-left: 0.3rem;
      }
    }
    .prdImg{
      width: 100%;
      height: 1.78rem;
    }
  }
  .dy-footer{
    .buyConfirm{
      width: 100%;
      height: 1rem;
      background: #EC1B30;
      line-height: 1rem;
      text-align: center;
      color: #fff;
      font-size: 0.34rem;
      font-weight: bolder;
      position: fixed;
      bottom: 0;
    }
  }
}
</style>
